package com.smsp.entity;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import java.util.Date;

public class User {
    private Integer id;

    @NotBlank(message = "用户名不能为空")
    @Length(max = 16, message = "用户名最大长度为16个字符")
    private String username;

    private String password;

    private String userStatus;

    private String userRole;

    @NotBlank(message = "公司名不能为空")
    @Length(max = 12, message = "公司名最大长度为16个字符")
    private String companyName;

    private Date createTime;

    private Date updateTime;

    public User(Integer id, String username, String password, String userStatus, String userRole, String companyName, Date createTime, Date updateTime) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.userStatus = userStatus;
        this.userRole = userRole;
        this.companyName = companyName;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    public User() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(String userStatus) {
        this.userStatus = userStatus == null ? null : userStatus.trim();
    }

    public String getUserRole() {
        return userRole;
    }

    public void setUserRole(String userRole) {
        this.userRole = userRole == null ? null : userRole.trim();
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName == null ? null : companyName.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}